#pragma once
#include <iostream>

using namespace std;

class FpString
{
public:
	FpString();
	~FpString();

	FpString(const FpString& newStr);
	FpString(const char* charStr);

public:
	FpString& operator=(const FpString& newStr);
	FpString& operator=(const char* newStr);

public:
	friend bool operator==(const FpString& leftStr, const FpString& rightStr);
	friend bool operator==(const FpString& leftStr, const char* rightCharStr);
	friend bool operator==(const char* leftCharStr, const FpString& rightStr);

	friend bool operator!=(const FpString& leftStr, const FpString& rightStr);
	friend bool operator!=(const FpString& leftStr, const char* rightCharStr);
	friend bool operator!=(const char* leftCharStr, const FpString& rightStr);

	friend bool operator>(const FpString& leftStr, const FpString& rightStr);
	friend bool operator>(const FpString& leftStr, const char* rightCharStr);

	friend bool operator<(const FpString& leftStr, const FpString& rightStr);
	friend bool operator<(const FpString& leftStr, const char* rightCharStr);

	friend bool operator>=(const FpString& leftStr, const FpString& rightStr);
	friend bool operator>=(const FpString& leftStr, const char* rightCharStr);

	friend bool operator<=(const FpString& leftStr, const FpString& rightStr);
	friend bool operator<=(const FpString& leftStr, const char* rightCharStr);

public:
	friend FpString operator+(const FpString& leftStr, const FpString& rightStr);
	friend FpString operator+(const FpString& leftStr, const char* rightCharStr);

	FpString& operator+=(const FpString& newStr);
	FpString& operator+=(const char* rightCharStr);

public:
	friend ostream& operator<<(ostream& os, const FpString& ccStr);
	friend istream& operator>>(istream& is, FpString& ccStr);

public:
	char& operator[](int index);
	const char& operator[](int index) const;
	operator char* ();

public:
	char* pointer() const;
	char* c_str() const;
	int		length() const;
	bool	empty() const;

private:
	char* str;
	int		len;
};
